package org.cll.lagou.study.imvctest.controller;

import org.cll.lagou.study.imvc.annotation.IAutowired;
import org.cll.lagou.study.imvc.annotation.IController;
import org.cll.lagou.study.imvc.annotation.IRequestMapping;
import org.cll.lagou.study.imvc.annotation.ISecurity;
import org.cll.lagou.study.imvc.config.AjaxResult;
import org.cll.lagou.study.imvctest.service.IDemoService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 描述信息:
 *
 * @author CLL
 * @version 1.0
 * @date 2020/6/21 14:52
 */
@IController
@IRequestMapping(value = "/demo")
public class IDemoController {

    private static final Logger logger = LoggerFactory.getLogger(IDemoController.class);

    @IAutowired
    private IDemoService iDemoService;

    @ISecurity(value = "zhangsan")
    @IRequestMapping(value = "/query")
    public AjaxResult query(HttpServletRequest request, HttpServletResponse response, String name) {
        return iDemoService.query(name);
    }

    @ISecurity(value = "lisi")
    @IRequestMapping(value = "/handler01")
    public AjaxResult handler01(HttpServletRequest request, HttpServletResponse response, String name) {
        return iDemoService.query(name);
    }

    @ISecurity(value = "wangwu")
    @IRequestMapping(value = "/handler02")
    public AjaxResult handler02(HttpServletRequest request, HttpServletResponse response, String name) {
        return iDemoService.query(name);
    }
}